package MyList;

import java.util.ArrayList;
import java.util.List;

public class MySingleList implements IList {

    static class ListNode {
        public int val;
        public ListNode next;

        public ListNode() {

        }

        public ListNode(int val) {
            this.val = val;
        }
    }
    //链表的头结点
    public ListNode head = null;
    @Override
    public void addFirst(int data) {

    }

    @Override
    public void addLast(int data) {

    }

    @Override
    public void addIndex(int index, int data) {

    }

    @Override
    public boolean contains(int key) {
        return false;
    }

    @Override
    public void remove(int key) {

    }

    @Override
    public void removeAllKey(int key) {

    }

    @Override
    public int size() {
        return 0;
    }

    @Override
    public void clear() {
        head = null;
    }

    @Override
    public void display() {

    }
    public void middNode() {
        ListNode fast = head;
        ListNode slow = head;
        ListNode cur = new ListNode();
        while(fast!=null) {
            fast = fast.next.next;
            slow = slow.next;
            cur = slow;
        }
    }
}
